<?php
/* @var $this MenuController */
/* @var $model Menu */

$this->breadcrumbs=array(
	'Menu'
);


Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('menu-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>

<?php $this->widget('ext.widgets.grid.AxGridView', array(
	'id'=>'menu-grid',
    'title' => 'Grid Title',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
			'name'	=> 'parent_id',
			'type'	=> 'raw',
			'header'=> 'Parent',
			//'value' => 'Menu::model()->findByPk($data->parent_id)->title',
			'value' => array($this, 'Abc'),
			//'value' => '$data->getparent->title',
        ),
		'title',
		'url',
        array(
            'header' => 'Action',
            'class' => 'ext.widgets.grid.AxActionColumn',
            'buttons' => array(
                array('label' => 'View', 'url' => array('view')),
                array('label' => 'Edit', 'url' => array('update')),
                array('label' => 'Delete', 'url' => array('delete'), "ajax" => true,'confirm' => 'Are you sure want to delete?'),
             )), 
	),
)); ?>
